7 f = LFSaw.kr(0.4, 0, 24, LFSaw.kr([8,7.23], 0, 3, 80)).midicps; // glissando function
8 zout = CombN.ar(SinOsc.ar(f, 0, 0.04), 0.2, 0.2, 4); // echoing sine wave
9 Out.ar(0, zout.postln);
12 SynthDef("moto-rev", {
14 x = RLPF.ar(LFPulse.ar(SinOsc.kr(0.2, 0, 10, 21), [0,0.1], 0.1), 100, 0.1).clip2(0.4);
18 SynthDef("thru", { arg out, gate=1;
20 env = Linen.kr(gate, 2, 1, 2);
21 XOut.ar(out, env, ClipNoise.ar([0.1,0.1]));
22 FreeSelfWhenDone.kr(env);
25 SynthDef("wah", { arg out, rate = 1.5, cfreq = 1400, mfreq = 1200, rq=0.1, wet=1, gate=1;
28 cfreq = Lag3.kr(cfreq, 0.1);
29 mfreq = Lag3.kr(mfreq, 0.1);
30 env = Linen.kr(gate, 1, 1, 1);
31 wet = Ramp.kr(wet, 0.1);
32 rq = Ramp.kr(rq, 0.1);
33 zout = RLPF.ar(zin, LFNoise1.kr(rate, mfreq, cfreq), rq, 10).distort * 0.15;
34 XOut.ar(out, wet * env, zout);
35 FreeSelfWhenDone.kr(env);
38 SynthDef("combdist", { arg out, freq = 400, decay=2, wet=1, gate=1;
41 freq = Lag3.kr(freq, 0.1);
42 env = Linen.kr(gate, 1, 1, 1);
43 wet = Ramp.kr(wet, 0.1);
44 zout = CombN.ar(zin, 24.midicps.reciprocal, freq.reciprocal, decay).distort.reverse;
45 XOut.ar(out, wet * env, zout);
46 FreeSelfWhenDone.kr(env);
49 SynthDef("echo", { arg out, maxdelay = 0.5, delay = 0.4, decay=3, wet=1, gate=1;
52 delay = Lag3.kr(delay, 0.1);
53 env = Linen.kr(gate, 1, 1, 1);
54 wet = Ramp.kr(wet, 0.1);
55 zout = CombN.ar(zin * env, maxdelay, delay, decay).reverse;
56 XOut.ar(out, wet * env, zout);
57 FreeSelfWhenDone.kr(env);
60 SynthDef("reverb", { arg out, decay=6, wet=1, gate=1;
63 env = Linen.kr(gate, 0.1, 1, 0.1);
64 wet = Ramp.kr(wet, 0.1);
65 decay = Ramp.kr(decay, 0.1);
67 zout = AllpassN.ar(zout, 0.04, {Rand(0.001,0.04)}.dup, decay)
69 XOut.ar(out, wet * env, zout);
70 FreeSelfWhenDone.kr(env);
73 SynthDef("ring-mod", { arg out, freq=800, wet=1, gate=1;
75 freq = Ramp.kr(freq, 0.1);
76 env = Linen.kr(gate, 1, 1, 1);
77 wet = Ramp.kr(wet, 0.1);
79 zout = zin * SinOsc.ar(freq, [0,0.5pi]);
80 XOut.ar(out, wet * env, zout);
81 FreeSelfWhenDone.kr(env);
87 a = sqrt(1 - b.squared);
88 XFadeOut.ar(chan, xfade, outs)
90 fade in an effect, fade out an effect.
92 simple mix architecture:
93 8 stereo inputs with gain & balance.
94 4 insert fx per input with 4 params each.
106 var channels, faders, master;
107 channels = In.ar(4, 16).clump(2);
108 master = Ramp.kr(In.kr(0, 1), 0.05);
109 faders = Ramp.kr(In.kr(1, 8), 0.05);
110 Out.ar(0, Mix(channels * faders) * master);
113 SynthDef("line", { arg out, start=1, end=0, dur=3;
115 line = Line.kr(start, end, dur);
116 ReplaceOut.kr(out, line);
117 FreeSelfWhenDone.kr(line);
120 SynthDef("xline", { arg out, start=1, end=0.0001, dur=3;
122 line = XLine.kr(start, end, dur);
124 FreeSelfWhenDone.kr(line);
132 //patch a control to read from a bus.
134 //gradually change a parameter over some period.
139 server = Server.local;
148 server.sendBundle(d, ["/s_new", "moto-rev", 1000, 0]);
152 //server.sendBundle(d, ["nod.free", 1000]);
155 server.sendMsg("/n_free", 1000);
167 server = Server.local;
173 server.sendBundle(d, ["/s_new", "bubbles", 1000, 0].postln);
175 // add effects, each one (processing order) after the previous one
177 server.sendBundle(d, ["/s_new", "combdist", 1004, 3,1000, \freq, rrand(24,60).midicps].postln);
179 server.sendBundle(d, ["/s_new", "wah", 1001, 3,1004].postln);
182 server.sendBundle(d, ["/s_new", "echo", 1002, 3, 1001,\delay, 0.2, \decay, 4].postln);
185 server.sendBundle(d, ["/s_new", "ring-mod", 1003, 3,1002, \delay, 0.2, \decay, 4].postln);
189 // release the gates by setting them to 0, allowing synths to die
190 server.sendBundle(d, ["/n_set", 1004, "gate", 0].postln);
193 server.sendBundle(d, ["/n_set", 1001, "gate", 0].postln);
196 server.sendBundle(d, ["/n_set", 1002, "gate", 0].postln);
199 server.sendBundle(d, ["/n_set", 1003, "gate", 0].postln);
202 server.sendBundle(d, ["/n_free", 1000].postln);
205 server.sendBundle(d, ["/g_freeAll", 0].postln);
214 // default node def not written
215 //f = { arg o; Pbind(\note, Pxrand([0,2,3,5,7,9,10,12],inf), \octave, o, \dur, 0.25) };
216 //Ppar([f.value(7),f.value(6), f.value(5)]).play(Event.protoEvent)
218 Server.default.sendMsg("/notify", 1);
220 SynthDef("default", { arg freq=440, gate=1, amp=0.2;
222 e = EnvGen.kr(Env.linen(0.004,amp,0.5), gate);
223 FreeSelfWhenDone.kr(e);
224 s = SinOsc.ar(freq,0, e);